home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / accessibility / nsAccessibleEventData.h next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  136 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   Kyle Yuan (kyle.yuan@sun.com)
  24.  *   John Sun (john.sun@sun.com)
  25.  *
  26.  * Alternatively, the contents of this file may be used under the terms of
  27.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  28.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29.  * in which case the provisions of the GPL or the LGPL are applicable instead
  30.  * of those above. If you wish to allow use of your version of this file only
  31.  * under the terms of either the GPL or the LGPL, and not to allow others to
  32.  * use your version of this file under the terms of the MPL, indicate your
  33.  * decision by deleting the provisions above and replace them with the notice
  34.  * and other provisions required by the GPL or the LGPL. If you do not delete
  35.  * the provisions above, a recipient may use your version of this file under
  36.  * the terms of any one of the MPL, the GPL or the LGPL.
  37.  *
  38.  * ***** END LICENSE BLOCK ***** */
  39.  
  40. #ifndef _nsAccessibleEventData_H_
  41. #define _nsAccessibleEventData_H_
  42.  
  43. #include "nsCOMPtr.h"
  44. #include "nsIAccessibleEvent.h"
  45. #include "nsIAccessible.h"
  46. #include "nsIAccessibleDocument.h"
  47. #include "nsIDOMNode.h"
  48.  
  49. class nsAccessibleEventData: public nsIAccessibleEvent
  50. {
  51.   public:
  52.     // Initialize with an nsIAccessible
  53.     nsAccessibleEventData(PRUint32 aEventType, nsIAccessible *aAccessible, 
  54.                           nsIAccessibleDocument *aDocAccessible, 
  55.                           void *aEventData);
  56.     // Initialize with an nsIDOMNode
  57.     nsAccessibleEventData(PRUint32 aEventType, nsIDOMNode *aDOMNode,
  58.                           nsIAccessibleDocument *aDocAccessible,
  59.                           void *aEventData);
  60.     virtual ~nsAccessibleEventData() {};
  61.  
  62.     NS_DECL_ISUPPORTS
  63.  
  64.     //nsIAccessibleEvent
  65.     NS_IMETHOD GetEventType(PRUint32 *aEventType) {*aEventType = mEventType; return NS_OK;}
  66.     NS_IMETHOD GetAccessible(nsIAccessible **aAccessible);
  67.     NS_IMETHOD GetAccessibleDocument(nsIAccessibleDocument **aDocAccessible) 
  68.       {NS_ADDREF(*aDocAccessible = mDocAccessible); return NS_OK;}
  69.     NS_IMETHOD GetDOMNode(nsIDOMNode **aDOMNode);
  70.  
  71.   private:
  72.     PRUint32 mEventType;
  73.     nsCOMPtr<nsIAccessible> mAccessible;
  74.     nsCOMPtr<nsIDOMNode> mDOMNode;
  75.     nsCOMPtr<nsIAccessibleDocument> mDocAccessible;
  76.     void *mEventData;
  77. };
  78.  
  79. // XXX todo: We might want to use XPCOM interfaces instead of structs
  80. //     e.g., nsAccessibleTextChangeEvent: public nsIAccessibleTextChangeEvent
  81. //           
  82.  
  83. struct AtkStateChange {
  84.   PRUint32 state;
  85.   PRUint32 extState;
  86.   PRBool   enable;
  87.   AtkStateChange() {
  88.     state = 0;
  89.     extState = 0;
  90.     enable = PR_FALSE;
  91.   }
  92. };
  93.  
  94. enum AtkProperty {
  95.   PROP_0,           // gobject convention
  96.   PROP_NAME,
  97.   PROP_DESCRIPTION,
  98.   PROP_PARENT,      // ancestry has changed
  99.   PROP_VALUE,
  100.   PROP_ROLE,
  101.   PROP_LAYER,
  102.   PROP_MDI_ZORDER,
  103.   PROP_TABLE_CAPTION,
  104.   PROP_TABLE_COLUMN_DESCRIPTION,
  105.   PROP_TABLE_COLUMN_HEADER,
  106.   PROP_TABLE_ROW_DESCRIPTION,
  107.   PROP_TABLE_ROW_HEADER,
  108.   PROP_TABLE_SUMMARY,
  109.   PROP_LAST         // gobject convention
  110. };
  111.  
  112. struct AtkPropertyChange {
  113.   PRInt32 type;     // property type as listed above 
  114.   void *oldvalue;  
  115.   void *newvalue;
  116. };
  117.  
  118. struct AtkChildrenChange {
  119.   PRInt32      index;  // index of child in parent 
  120.   nsIAccessible *child;   
  121.   PRBool        add;    // true for add, false for delete
  122. };
  123.  
  124. struct AtkTextChange {
  125.   PRInt32  start;
  126.   PRUint32 length;
  127.   PRBool   add;     // true for add, false for delete
  128. };
  129.  
  130. struct AtkTableChange {
  131.   PRUint32 index;   // the start row/column after which the rows are inserted/deleted.
  132.   PRUint32 count;   // the number of inserted/deleted rows/columns
  133. };
  134.  
  135. #endif  
  136.